1. Field of the Invention
This invention pertains to a data shifting circuit of a central processing unit, e.g., for use in a computer.
2. Description of the Related Arts
A central processing unit (hereafter abbreviated as CPU) has a data shifting circuit comprising a shifter and a register file.
FIG. 1 is a block diagram of a conventional data shifting circuit in a CPU comprising a shifter 1, a register file 2, an ALU (Arithmetic and Logical Unit) 3 and an internal bus 4.
In FIG. 1, a register in the register file 2 is selected, and its content is outputted to a port B1 which outputs the contents to the shifter 1. The shifter 1 shifts the received content by a predetermined shift width for output back to the register file 2 through the internal bus 4, which is written into a predetermined register. This concludes a cycle of a shifting operation. Here, a port A1 of the register file 2 is for use in an operation by the ALU 3.
The number of bits handled by a shifter is generally equal to the number of bits handled by the corresponding CPU. For instance, when a CPU processes sixteen (16) bits of data at a time, the shifter also processes sixteen (16) bits at a time. However, to ease software processing, a shifter sometimes requires the double shifting width.
In enabling an original shift width to be doubled, it is necessary to leave the original shifter function "as is", so as to maintain the compatibility with the original shift width. When a shifter originally rotate-shifting sixteen (16) bits is made capable of rotate-shifting thirty-two (32) bits by doubling the shift width, for instance, if it sacrifices its function of rotate-shifting sixteen (16) bits, the shifter loses its original function.
To overcome this problem, a prior art method has called for a provision of two shifters, one for the original shift width and the other for the double shift width.
However, the use of two shifters necessitates a larger hardware volume, which hinders practical application, especially when a CPU handles a word having a large number of bits.